<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of MY_Controller
 *
 * @author QuangBV
 */
class MY_Controller extends CI_Controller{
    //put your code here
    function __construct() {
        parent::__construct();
        $this->load->library('session');
        if ($this->session->userdata("logged_in") == '') {
            session_start();
        }
    }
    
    
    public function check_login() {
        if ($this->session->userdata('logged_in') != '')
            return true;
        else {
            redirect(base_url().'/admin/login');
            return false;
        }
    }
    
}

?>
